#!/bin/bash
number=65       #定义一个退出值
index=1          #定义一个计数器
if [ -z "$1" ];then              #对用户输入的参数做判断，如果未输入参数则返回脚本的用法并退出，退出值65
  echo "Usage:$0 + canshu"
  exit $number
fi
echo "listing args with \$*:"         #在屏幕输入，在$*中遍历参数
for arg in $*
do
  echo "arg: $index = $arg"
  let index+=1
done
echo
index=1                       #将计数器重新设置为1
echo "listing args with \"\$@\":"    #在"$@"中遍历参数
for arg in "$@"
do
  echo "arg: $index = $arg"
  let index+=1
done
